(autoload 'mew "mew" nil t)
(autoload 'mew-send "mew" nil t)
(require 'mew-w3m) ;需要w3m支持，看html邮件
 
;; Optional setup (Read Mail menu for Emacs 21):
(if (boundp 'read-mail-command)
    (setq read-mail-command 'mew))
 
;; Optional setup (e.g. C-xm for sending a message):
(autoload 'mew-user-agent-compose "mew" nil t)

(if (boundp 'mail-user-agent)
    (setq mail-user-agent 'mew-user-agent)
)

(if (fboundp 'define-mail-user-agent)
    (define-mail-user-agent
      'mew-user-agent
      'mew-user-agent-compose
      'mew-draft-send-message
      'mew-draft-kill
      'mew-send-hook)
)

(when (boundp 'utf-translate-cjk)
      (setq utf-translate-cjk t)
      (custom-set-variables  '(utf-translate-cjk t))
)


(setq mew-use-cached-passwd t) 
(setq mew-pop-size 0)   ;; mew-pop-size设置成0时，pop邮件大小没有限制  
(setq mew-pop-delete nil)  ;; 不删除服务器上的邮件  
(setq mew-ssl-verify-level 0)
(setq mew-imap-size 0)
(setq mew-imap-delete nil)
(setq mew-file-max-size 30000000)
(setq mew-auto-get t)
(setq mew-debug t)

(setq mew-config-alist
   '(
      ;; Default fetch mailbox is IMAP
      (default
         (mailbox-type          "imap")
         (proto                 "%")
         (imap-ssl-server       "imap.gmail.com")
         (imap-server           "imap.gmail.com")
         (imap-ssl-port         993)
         (imap-ssl              t)
         (imap-user             "cutemiex")
         (imap-auth             pass)
         (mail-domain           "gmail.com")
         (imap-size             0)
         (imap-delete           nil)
         (imap-queue-folder     "%queue")
         (imap-trash-folder     "%Trash") ;; This must be in concile with your IMAP box setup
         (smtp-auth-list        ("PLAIN" "LOGIN" "CRAM-MD5"))
         (smtp-user             "cutemiex@gmail.com")
         (smtp-ssl	        t)
         (smtp-ssl-port         "465")
         (smtp-server           "smtp.gmail.com")
      )
      ;; ;;news group comp.lang.c
      ;; (usenet
      ;; 	 (mailbox-type          mbox)
      ;; 	 (proto                 -)
      ;; 	 (nntp-server           "news.aioe.org")
      ;; 	 (nntp-user             nil) ;; should be nil defaulty
      ;; 	 (nntp-header-only      nil)
      ;; 	 (nntp-newsgroup        "-comp.lang.c") ;; little '-'
      ;; 	 (nntp-size             0)
      ;; 	 (nntp-msgid-user       "User Mew")
      ;; 	 (smtp-auth-list        ("PLAIN" "LOGIN" "CRAM-MD5"))
      ;; 	 (smtp-user             "smtpuser@gmail.com")
      ;; 	 (smtp-server           "smtp.gmail.com")
      ;; ) 
     
      (pop163
        (mailbox-type  "pop")
        (proto         "$")
        (name          "cutemiex")
        (user          "cutemiex@163.com")
        (mail-domain   "163.com")
        (pop-server    "pop.163.com")
        (pop-port      "110")
        (pop-user      "cutemiex@163.com")
        (pop-auth      pass)
        (smtp-server   "smtp.163.com")
        (smtp-port     "25")
        (smtp-user     "cutemiex@163.com")
        (smtp-auth-list  ("CRAM-MD5" "LOGIN" "PLAIN"))
      )
))


;; (defvar mew-cite-fields '("From:" "Subject:" "Date:"))
;; (defvar mew-cite-format "From: %s\nSubject: %s\nDate: %s\n\n")
;; (defvar mew-cite-prefix "> ")